<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="vue2.2.js">
    </script>
    <script src="vue-router.js">
    </script>
</head>
<body>
<template id="tplLogin">
    <div>
        用户名: <input type="text"> <br>
        密码： <input type="password"> <br>
        <button>登录</button>
    </div>
</template>
<script>
    var Login = {
        template: "#tplLogin"
    }
</script>
<template id="tplIndex">
    <div>
        <h1>这里是首页</h1>
    </div>

</template>
<script>
    var Index = {
        template: "#tplIndex"
    }
</script>
<script>
    var routes = [
        {path: "/index", component: Index},
        {path: "/login", component: Login}
    ];
    var router = new VueRouter({routes});
</script>
<div id="app">
    <route-view>

    </route-view>
</div>
<script>
    new Vue({
        el: '#app',
        data: {},
        router
    })
</script>
</body>
</html>